package com.roc.service;

import java.util.List;
import java.util.Map;

import com.roc.pojo.EsmidinfoMerinfo;
import com.roc.pojo.EsmidinfoTmp;
import com.roc.pojo.Operators;
import com.roc.pojo.ProfitPercent;
import com.roc.pojo.ProfitRule;
import com.roc.pojo.TblOrgMain;

/**
 * @author zbl
 * @date 2014-08-07
 * 代理商
 * */
public interface IAgentService {
	//申请代理商,返回登录密码
	String issueAgent(Operators  op,String  opAccount,Operators logingOperators)throws ServiceException;
	//申请一级代理商,返回登录密码
	String isAddOneAgent(Operators  op,String  opAccount,Operators logingOperators)throws ServiceException;
	
	//终审商户生成操作员并且添加权限(不同于上)
	void addOperators(Operators op, EsmidinfoTmp tmp,EsmidinfoMerinfo esMer,String  mid) throws ServiceException;
	
	/**
	 * 代理商用户信息编辑
	 * @param op
	 * @param opAccount
	 * @param logingOperators
	 * @throws ServiceException
	 */
	public void editAgent(Operators op,Operators oldOp,Operators logingOperators) throws ServiceException;
	
	
	List<ProfitRule> queryProfitRule(String id) throws ServiceException;
	
	public void deleteProfitRuleByAgentId(String agentId)  throws ServiceException;
	
	/**
	 * 查询代理商的可用的分润规则,返回map结构
	 * @param id
	 * @param roleType
	 * @return
	 * @throws ServiceException
	 */
	public Map<String,String> getMccArray4Agent(String id,String roleType) throws ServiceException;
	
	/**
	 * 获取代理商的分润比例
	 * @param agentId
	 * @return
	 * @throws ServiceException
	 */
	public List<ProfitPercent> queryProfitPer(String agentId) throws ServiceException;
	
	
	public Map<String,String> queryProfitPerMap(String agentId) throws ServiceException;
	/**
	 * 获取代理商的父级分公司以及直属代理
	 * @param agentId
	 * @return
	 * @throws ServiceException
	 */
	public Map<String,String> queryAgentDirectMap(String agentId)throws ServiceException;
	
	/**
	 * 根据区域得到机构
	 * @param areaId
	 * @return
	 * @throws ServiceException
	 */
	public List<TblOrgMain> queryOrgMainListByArea(String areaId) throws ServiceException;
	
	/**
	 * 得到下级代理商
	 * @param agentId
	 * @return
	 * @throws ServiceException
	 */
	public List<Operators> queryOperatorListBySupId(String agentId) throws ServiceException;
	
	/**
	 * 得到收单机构下所有机构
	 * @param ordCode
	 * @return
	 * @throws ServiceException
	 */
	public List<TblOrgMain> queryOrgMainListByOrg() throws ServiceException;

	/**
	 * 通过类别查询黑名单信息 
	 * @param blackType 类别
	 * @param blackNum (1)P：手机号 / (2)D：法人身份证 / (4)C： 卡号
	 * @return
	 * @throws ServiceException
	 */
	int selectBlackInfoByType(String blackType,String blackNum) throws ServiceException;
}
